#include "structs.h"
#include <vector>

point::point(double x_, double y_)
{
	x = x_;
	y = y_;
}

point::point()
{
	x = 0;
	y = 0;
}

bool point::operator < (const point &p)
{
	return ((x < p.x) || ((x == p.x) && (y < p.y)));
}

bool point::operator == (const point &p)
{
	return ((x == p.x) && (y == p.y));
}

bool point::operator != (const point &p)
{
	return ((x != p.x) || (y != p.y));
}

circle::circle (const point &p)
{
	bound = std::vector<point> ();
	bound.push_back(p);
}

circle::circle (const point &p1, const point &p2)
{
	bound = std::vector<point> ();
	bound.push_back(p1);
	bound.push_back(p2);
}

circle::circle (const point &p1, const point &p2, const point &p3)
{
	bound = std::vector<point> ();
	double s12 = sqrhypot(p1, p2);
	double s13 = sqrhypot(p1, p3);
	double s23 = sqrhypot(p2, p3);
	if (s23 + s13 < s12)
	{
		bound.push_back(p1);
		bound.push_back(p2);
	}
	else if (s12 + s23  < s13)
	{
		bound.push_back(p1);
		bound.push_back(p3);
	}
	else if (s12 + s13 < s23)
	{
		bound.push_back(p2);
		bound.push_back(p3);
	} 
	else 
	{
		bound.push_back(p1);
		bound.push_back(p2);
		bound.push_back(p3);
	}
}
